package cn.ctbu.edu.labtest.controller;

import cn.ctbu.edu.labtest.domain.student;
import cn.ctbu.edu.labtest.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
class StudentController {

    @Autowired
    StudentService studentService;

    @RequestMapping("/student/list")
    public String list(Model model){
        List<student> students=studentService.findAll();
        model.addAttribute("data",students);
        return"/student/list";
    }
}
